package heima_design.model02;
/**
 * @ClassName: Singleton
 * @Description: 饿汉式单例 - 静态代码块
 * @Version: v1.0.0
 * @Author: tamir
 * @Date: 2022/06/02
 * Modification History:
 * Date             Author      Version     Description
 * -------------------------------------------------------------
 * 2022/06/02      tamir        v1.0.0      创建
 */
public class Singleton {
	//私有构造方法
	private Singleton(){}
	//在成员位置创建该类的对象
	private static Singleton instance;
	
	static {
		instance = new Singleton();
	}
	
	//对外提供几台方法获取该对象
	public static Singleton getInstance(){
		return instance;
	}
	
}
